public class ConstantData
{
    private static ConstantData _instance;
    public static ConstantData instance
    {
        get
        {
            if (_instance == null)
                _instance = new ConstantData();
            return _instance;
        }
    }

    
    public ConstantData()
    {
        InitDefaultSkins();
        InitDefaultCandidates();
    }

    
    public const int defaultSkin = 1;
    
    private ConstSkinData[] m_Skins;
    public ConstSkinData[] skins => m_Skins;
    private ConstCandidateData[] m_Candidates;
    public ConstCandidateData[] candidates => m_Candidates;

    void InitDefaultSkins()
    {
        m_Skins = new ConstSkinData[] {
            new ConstSkinData() {skinId = 1, price = 0, enabled = true}
            , new ConstSkinData() {skinId = 2, price = 1500, enabled = true}
            , new ConstSkinData() {skinId = 3, price = 2000, enabled = true}
            , new ConstSkinData() {skinId = 4, price = 3000, enabled = true}
            , new ConstSkinData() {skinId = 5, price = 4000, enabled = true}
            , new ConstSkinData() {skinId = 6, price = 5000, enabled = true}
        } ;
    }

    public ConstSkinData GetSkin(int skinId)
    {
        return System.Array.Find(skins, e => e.skinId == skinId);
    }
    
    void InitDefaultCandidates()
    {
        m_Candidates = new ConstCandidateData[] {
              new ConstCandidateData() {candidateId = 1, name = "Rebecca",location = "Secaucus",job = "Salesperson",fiveDimensions = new FiveDimensions(1995, 20000,158,45,0),requirement = new FiveDimensions(1985, 40000,170,55,0),price = 0, enabled = true}
            , new ConstCandidateData() {candidateId = 2, name = "Elena",location = "New York",job = "Teacher",fiveDimensions = new FiveDimensions(1998, 40000,165,56,3),requirement = new FiveDimensions(1985, 60000,175,60,3),price = 1500, enabled = true}
            , new ConstCandidateData() {candidateId = 3, name = "Anna",location = "New York",job = "Accountant",fiveDimensions = new FiveDimensions(1999, 60000,164,55,3),requirement = new FiveDimensions(1985, 80000,175,65,3),price = 2000, enabled = true}
            , new ConstCandidateData() {candidateId = 4, name = "Catherine",location = "New York",job = "Nurse",fiveDimensions = new FiveDimensions(2001, 30000,168,60,2),requirement = new FiveDimensions(1985, 50000,175,65,2),price = 3000, enabled = true}
            , new ConstCandidateData() {candidateId = 5, name = "Michelle",location = "New York",job = "Psychologist",fiveDimensions = new FiveDimensions(1996, 80000,170,62,3),requirement = new FiveDimensions(1985, 100000,180,70,3),price = 4000, enabled = true}
            , new ConstCandidateData() {candidateId = 6, name = "Lisa",location = "New York",job = "Lawyer",fiveDimensions = new FiveDimensions(1997, 100000,169,58,4),requirement = new FiveDimensions(1985, 100000,178,65,3),price = 5000, enabled = true}
        } ;
    }

    public ConstCandidateData GetCandidate(long skinId)
    {
        return System.Array.Find(candidates, e => e.candidateId == skinId);
    }
}
public class ConstSkinData
{
    public int skinId;
    public int price;
    public bool enabled;
}

public enum FiveDimensionsType
{
    Age,
    Income,
    Height,
    Weight,
    Edu,
}
public struct FiveDimensions
{
    public float birthYear;
    public float Income;
    public float Height;
    public float Weight;
    public int Education;
    
    public FiveDimensions(float birthYear, float income, float height, float weight, int education)
    {
        this.birthYear = birthYear;
        Income = income;
        Height = height;
        Weight = weight;
        Education = education;
    }

    public static FiveDimensions DefaultValue()
    {
        return new FiveDimensions(1995,10000,163,50,0);
    }

    /*public static FiveDimensions operator + (FiveDimensions a, FiveDimensions b)
    {
        return new FiveDimensions()
        {
            Magic = a.Magic + b.Magic,
            Income = a.Income + b.Income,
            Height = a.Height + b.Height,
            Weight = a.Weight + b.Weight,
            Education = a.Education + b.Education
        };
    }*/
}

public class ConstCandidateData
{
    public long candidateId;
    public int price;
    public string name;
    public string job;
    public string location;
    public FiveDimensions fiveDimensions;
    public FiveDimensions requirement;
    public bool enabled;
}